package com.rd.student.jiaji.class3.wangyanbo.task25;

import java.io.File;
import java.io.IOException;

public class TestFile1 {
    public static void main(String[] args) {
        String p = System.getProperty("user.dir");
        File f1 = new File(p + "\\" + "f1");
        File f2 = new File(p + "\\" + "f2");
        f1.mkdir();
        f2.mkdir();
        File t1 = new File(f1 + "\\" + "t1.txt");
        File t2 = new File(f1 + "\\" + "t2.txt");
        File t3 = new File(f2 + "\\" + "t3.txt");
        File t4 = new File(f2 + "\\" + "t4.txt");
        File t5 = new File(f2 + "\\" + "t5.txt");
        try {
            t1.createNewFile();
            t2.createNewFile();
            t3.createNewFile();
            t4.createNewFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        t3.renameTo(t5);
        t4.delete();
        String[] strList = f1.list();
        for (String s : strList) {
            System.out.println(s);
        }
        String[] strList1 = f2.list();
        for (String s : strList1) {
            System.out.println(s);
        }


    }
}
